home *** CD-ROM | disk | FTP | other *** search
- /* WordHost -- The ARexx Spelling Checker Oct 7 1994
-
- Run WordHost from a shell with the name of a word list file as the only
- argument. The included 'words' file works nicely. The program is a small
- ARexx host which accepts commands sent to the port SPELLER_PORT. The 2
- possible commands are __QUIT, which will terminate the host, or any other
- word, which will be sought in the words file. If the word is found, the
- host will return 1 otherwise the result will be 0. WordHost also acts as
- a function host, with the sole function being Spell(word) which returns 1
- or 0. The function host use is more elegant for longer scripts, whicl the
- command host behavior is handy for one-liners and sending commands from
- other applications.
-
- These are handy aliases:
- alias spell rx "options results ; address SPELLER_PORT ; []; say result"
- alias spquit rx "address SPELLER_PORT __quit"
-
- An example ARexx script follows... rx this file! */
-
- /* The command host example. this will actually run */
- options results
- address SPELLER_PORT
- arg line
- if line ="" then line = "The quick brown fpx jumped the lazy dog"
- say "Spell Checking: "line
- i=1
- w=word(line,i)
- do while(w~="")
- i=i+1
- w
- if result=0 then say w" ain't spelt too good!"
- else say w
- w=word(line,i)
- end
-
-
- /* Function host version... possibly more convenient for scripts
- options results
- call addlib(SPELLER_PORT,0)
- arg line
- if line ="" then line = "The quick brown fpx jumped the lazy dog"
- i=1
- say "Spell Checking: "line
- w=word(line,i)
- do while(w~="")
- i=i+1
- if ~SPELL(w) then say w" ain't spelt too good!"
- else say w
- w=word(line,i)
- end
- call remlib(SPELLER_PORT)
- */
-
-
-
-